package com.wn.ticket.service.impl;

import com.wn.ticket.entity.Admin;
import com.wn.ticket.mapper.AdminMapper;
import com.wn.ticket.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    @Override
    public Admin login(Admin admin) {
        return adminMapper.login(admin);
    }

    @Override
    public void add(Admin admin) {
        adminMapper.adminInsert(admin);
    }

    @Override
    public void update(Admin admin) {
        adminMapper.adminUpdate(admin);
    }

    @Override
    public List<Admin> getAll() {
        return adminMapper.adminlist();
    }

    @Override
    public Admin getByAccount(String account) {
        return adminMapper.getByAccount(account);
    }

    @Override
    public Admin getById(int id) {
        return adminMapper.getById(id);
    }


}
